ping.go should wait a resonable amout of time for the broker response · Issue #3 · eclipse/paho.mqtt.golang · GitHub

您所在的位置:网站首页 mqtt ping ping.go should wait a resonable amout of time for the broker response · Issue #3 · eclipse/paho.mqtt.golang · GitHub

ping.go should wait a resonable amout of time for the broker response · Issue #3 · eclipse/paho.mqtt.golang · GitHub

2023-04-11 08:53| 来源: 网络整理| 查看: 265

migrated from Bugzilla #486528 status RESOLVED severity normal in component MQTT-Go for 1.2 Reported in version unspecified on platform PC Assigned to: Al Stockdill-Mander

Original attachment names and IDs:

keepalive_timeout.patch (ID 259373)

On 2016-01-26 03:04:27 -0500, Manuel Rabade wrote:

Created attachment 259373 KeepAliveTimeout option

In ping.go the PINGREQ is sent according to the KeepAlive option but the routine expects a PINGRESP from the broker in just a second. The client should wait a resonable amount of time for the broker PINGRESP. In slow networks this bug provokes a lot of client disconnects from the broker.

I propose a KeepAliveTimeout option to configure a second timer in ping.go to wait for the broker answer.

On 2016-01-28 04:10:02 -0500, Al Stockdill-Mander wrote:

Looking at the ping timer and handling section I'm thinking I should probably move to using time.Timers rather than the 1 second sleep loop currently in place, in addition I agree that there should be a configurable timeout for pingresp handling.

On 2016-02-08 04:45:28 -0500, Al Stockdill-Mander wrote:

I've changed the ping code to use a proper time.Timer and added an option to allow you to set the amount of time to wait for a ping response, with a default of 10 seconds. Tests all pass, please let me know if this resolves your issue.



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3